<template>
  <section>
    <van-grid clickable :column-num="3">
      <van-grid-item
        v-for="(item,idx) in gridArr"
        :key="idx"
        :icon="item.icon"
        :text="item.text"
        @click="urlMessage(item.url)"
      />
    </van-grid>
  </section>
</template>

<script>
export default {
  data() {
    return {
      gridArr: [
        { icon: "label-o", text: "我的订单", url: "/" },
        { icon: "bill-o", text: "优惠券", url: "/" },
        { icon: "goods-collect-o", text: "礼品卡", url: "/" },
        { icon: "location-o", text: "我的收藏", url: "/" },
        { icon: "flag-o", text: "我的足迹", url: "/user/trace" },
        { icon: "user-o", text: "会员福利", url: "/" },
        { icon: "aim", text: "地址管理", url: "/user/address" },
        { icon: "warn-o", text: "账号安全", url: "/" },
        { icon: "manager-o", text: "联系客服", url: "/user/online" },
        { icon: "question-o", text: "帮助中心", url: "/" },
        { icon: "photo-o", text: "意见反馈", url: "/user/proposal" }
      ]
    };
  },
  methods : {
    urlMessage(url) {
      console.log(url);
      if(url == '/'){
        this.$toast.fail("该模块暂未开放")
      } else {
        this.$router.push(url)
      }
    }
  }
};
</script>

<style>
</style>